package com.example.securitydemo.util;

import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class Result<T> {

    private Integer code = 200;
    private String msg = "";
    private T data;



    //

    // 静态方法
    public static <T>  Result success(T t){
        return new Result<T>(200,"操作成功",t);
    }

    // 静态方法
    public static <T>  Result fail(T t){
        return new Result<T>(500,"操作失败",t);
    }

    // 静态方法
    public static <T>  Result accessDefined(T t){
        return new Result<T>(403,"没有权限操作",t);
    }


}
